#ifndef QIPADRESSEDITOR_H
#define QIPADRESSEDITOR_H

#include <QWidget>
#include <QUndoStack>
#include <QLineEdit>
#include <QAbstractSpinBox>
class QAbstractProperty;

class QIpAddressEditor : public QAbstractSpinBox
{
    Q_OBJECT
    Q_PROPERTY(int ipAddress READ address WRITE setAddress USER true)
public:
    Q_INVOKABLE QIpAddressEditor(QAbstractProperty* property,QUndoStack* stack,QWidget *parent = 0);
    ~QIpAddressEditor();

    int address();
    void setAddress(int address);
protected:
    void    update_value();
protected:
    void     keyPressEvent(QKeyEvent *event);
protected slots:
    void    edit_text_changed(const QString &t);
protected:
    QAbstractProperty   *m_property;
    int     m_current_index;
    int     m_ipAddress;

};

#endif // QIPADRESSEDITOR_H
